package edu.ynu.se.xiecheng.achitectureclass.project.dao;

import edu.ynu.se.xiecheng.achitectureclass.common.dao.LogicDAO;
import edu.ynu.se.xiecheng.achitectureclass.project.po.entity.Device;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public interface DeviceDao extends LogicDAO<Device, Long> {
    Optional<Device> findByDeviceId(String sensorId);

    @Query("select d from Device d where d.isDeleted = 0")
    List<Device> findAllByIsDeletedIsFalse();
}
